const connection = require("@/db/index.js");

function query (sql) {
  return new Promise((resolve, reject) => {
    connection.query(sql, (error, results, fields) => {
      if(error){
        reject(error)
        return false
      }
      resolve(results);
      // connection.end()
    })
  })
}
module.exports = { query }